<template>
  <div class="announcementArticles">
    <el-page-header @back="goback" content="通知公告">
    </el-page-header>
    <div class="richText_title">
      <h1>{{richText.title}}</h1>
    </div>
    <div class="richText_text">
      <div class="ql-editor " v-html="richText.text">{{ richText.text }}</div>
    </div>
  </div>
</template>

<script>
export default {
  name: "announcementArticles",
  data() {
    return{
      richText: {
      }
    }
  },
  methods: {
    goback(){
      this.$router.push('/information/announcement')
    },

    // 通过文章id获取文章
    async getArticleByID2(){
      const data  = {};
      data.id = window.sessionStorage.getItem('TextID');
      const text = await this.$api.getArticleByID(data)
      this.richText = text.article;
    }
  },
  mounted() {
    this.getArticleByID2();
  }
}
</script>

<style lang="less" scoped>
.announcementArticles{
  background-color: #ffffff;
  margin: 0 40px;
  padding: 10px 20px;
.richText_title{
  width: 1550px;
  margin: 0 auto;
  font-size: 25px;
  padding: 0 20px;
  text-align: center;
}
.richText_text{
  width: 1550px;
  margin: 20px auto;

}
}
</style>
